package com.tx.review.annotation.Inherited;

import java.util.Arrays;

/**
 * @author ：tx
 * @version:
 */
public class InheritedDemo {
    public static void main(String[] args) {
        A a = new B();
        System.out.println("我能获取到父类的注解信息：" + Arrays.toString(a.getClass().getAnnotations()));

        C c = new D();
        System.out.println("我能获取不到父类的注解信息：" + Arrays.toString(c.getClass().getAnnotations()));
    }
}


@DocumentA
class A{

}

class B extends A{

}


@DocumentB
class C{

}

class D extends C{

}